@layout("/common/_curd/_container.html"){

<script type="text/javascript">
	var ctx = "${basePath}";
	var grid_selector = "#grid-table";
	var pager_selector = "#grid-pager";
	
	$(function(){
		initGrid();
		initMenuBtn("btns", "${code}");
	});
	
	function initGrid(){
		var grid_url = ctx + "/${code}/list";
		var _colnames = ["项目名称",
						"申报单位", 
						"联系人", 
						"责任单位",
						"建设开始时间",
						"建设结束时间", 
						"预算（万）",
						"联系电话",
						"备注",
						"操作"
						];
		var _colmodel = [{name:"name", index:"name", width:100},
						{name:"dept_id", index:"dept_id", width:100},
						{name:"contact", index:"contact", width:100},
						{name:"responsible", index:"responsible", width:100},
						{name:"start", index:"start", width:100},
						{name:"over", index:"over", width:100},
						{name:"budget", index:"budget", width:100},
						{name:"phone", index:"phone", width:100},
						{name:"temarks", index:"temarks", width:100 },
						{name:"temarks", width:100,formatter:function (value,row,index) {
							var status = index.status
							if(status === 2){
								return '<a href="#" class="btn btn-btn btn-success btn-xs" onclick="back('+"'"+index.id+"'"+')">'+"退回"+'</a> &nbsp;<a href="#" class="btn btn-btn btn-success btn-xs" onclick="pass('+"'"+index.id+"'"+')">'+"通过"+'</a>';
							}else if(status === 3){
								return '<a href="#" class="btn btn-btn btn-success btn-xs" onclick="choosExpert('+"'"+index.id+"'"+')">'+"选择专家"+'</a>';
							}else {return " ";}

						}}
		];
		
		jQuery(grid_selector).jqGrid({
			url : grid_url,
		    shrinkToFit : true,
			colNames : _colnames,
			colModel : _colmodel, 
			jsonReader : {id :"id"},
			pager : pager_selector,
			postData : {sort : "id", order : "desc"}
		});
	}

	back = function (entId) {
		var index = layer.open({
			type: 2,
			title:'项目管理系统',
			area: ['90%', '70%'],
			maxmin:true,
			shadeClose: true, //点击遮罩关闭

			content:  '/projects/back?id='+ entId
		});

		this.layerIndex = index;
	};
	pass = function (entId) {
		var index = layer.open({
			type: 2,
			title:'项目管理系统',
			area: ['90%', '70%'],
			maxmin:true,
			shadeClose: true, //点击遮罩关闭

			content:  '/projects/auditOk?id='+ entId
		});

		this.layerIndex = index;
	};
	choosExpert = function (entId) {
		var index = layer.open({
			type: 2,
			title:'项目管理系统',
			area: ['90%', '70%'],
			maxmin:true,
			shadeClose: true, //点击遮罩关闭

			content:  '/projects/chooseExpert?id='+ entId
		});

		this.layerIndex = index;
	};
</script>


	<!-- 配置 grid -->
	<div class="row">
		<div class="col-xs-12 tb-grid">
			<!-- 配置 查询 -->
			@ var _col=[
@		{name:"主键", index:"id", type:"text"},
			@		{name:"申报单位", index:"dept_id", type:"text"},
			@		{name:"联系人", index:"contact", type:"text"},
			@		{name:"联系电话", index:"phone", type:"text"},
			@		{name:"责任单位", index:"responsible", type:"text"},
			@		{name:"建设开始时间", index:"start", type:"text"},
			@		{name:"建设结束时间", index:"over", type:"text"},
			@		{name:"预算（万）", index:"budget", type:"text"},
			@		{name:"备注", index:"temarks", type:"text"}
			@];
			@ include("/common/_function/_search.html",{"col":_col}){}
			<!-- 按钮 -->
			<div class="welljq well-sm" id="btns"></div>
			<!-- grid -->
			<table id="grid-table"></table>
			<!-- 分页-->
			<div id="grid-pager"></div>
		</div>
	</div>
	
	<!-- 引入所需的js -->
	@include("/common/_listscript.html"){}
	
@}	